﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace NMortgage.UI.Model
{
    public class MortgageProfile
    {
        public MortgageProfile()
        {
            ExtraPayments = new List<ExtraPayment>();
            InterestRates = new List<IInterestRate>();
        }
        public double LoanAmount { get; set; }
        public DateTime StartDate { get; set; }
        public PaymentFrequency PaymentFrequency { get; set; }
        public ICollection<IInterestRate> InterestRates { get; set; }
        public ICollection<ExtraPayment> ExtraPayments { get; set; }
        public int TermLength { get; set; }
        public int TotalPeriods {
            get {
                return TermLength * ((this.PaymentFrequency == PaymentFrequency.Monthly) ? 12 : 26);
            }
        }
        public DateTime EndDate
        {
            get
            {
                return StartDate.AddYears(TermLength);
            }
        }
    }
}
